<template>
  <div>
    <el-row style="margin-left:13px;">
      <div>
        <i
          style="font-size:20px"
          class="el-icon-info"
          @click="showSingeInfo"
        ></i>
      </div>
    </el-row>
    <el-dialog
      title="运单详情"
      :visible.sync="showDialogVisible"
      width="60%"
      center
    >
      <div>
        <el-table
          :data="tableData"
          style="width: 100%"
          v-if="null != tableData && tableData.length > 0"
        >
          <el-table-column type="index"> </el-table-column>
          <el-table-column prop="waybillNo" label="运单号"> </el-table-column>

          <el-table-column prop="masterNumber" label="M单号"> </el-table-column>
          <el-table-column prop="isTaxFarming" label="是否包税">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{
                yesNo[scope.row.isTaxFarming]
              }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="isCustomerDeclaration" label="是否报关">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{
                yesNo[scope.row.isCustomerDeclaration]
              }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="eoriIsCertified" label="是否自有进口商">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{
                yesNo[scope.row.eoriIsCertified]
              }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="dispatchAddressCode" label="仓库代码">
          </el-table-column>
          <el-table-column prop="inStockActualWeight" label="实重">
          </el-table-column>
          <el-table-column prop="inStockVolumeWeight" label="体积重">
          </el-table-column>
          <el-table-column prop="inStockChargedWeight" label="计费重">
          </el-table-column>
          <el-table-column prop="inStockTotalPackages" label="件数">
          </el-table-column>
        </el-table>
        <span style="margin-left:400px;" v-else>{{ titps }}</span>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { ajax } from "@/store/yg/common/utils";
import axios from "axios";
import * as constant from "@/store/yg/common/constant";
import { m } from "@/store/yg/common/local";

export default {
  props: ["row", "data", "more"],
  data() {
    return {
      fullscreenLoading: false,
      yesNo: {
        1: "是",
        0: "否"
      },
      titps: "努力加载中",
      tableData: [
        // {
        //   waybillNo: "",
        //   masterNumber: "",
        //   isTaxFarming: "",
        //   isCustomerDeclaration: "",
        //   eoriIsCertified: "",
        //   dispatchAddressCode: "",
        //   inStockActualWeight: "",
        //   inStockVolumeWeight: "",
        //   inStockChargedWeight: "",
        //   inStockTotalPackages: ""
        // }
      ],
      showDialogVisible: false,
      systemReamrk: ""
    };
  },

  methods: {
    showSingeInfo() {
      this.showDialogVisible = true;
      var param = {};
      param["id"] = this.data["id"];
      this.fullscreenLoading = true;
      ajax("viewSeaAirSingleWaybillNoDetail", param).then(
        res => {
          this.fullscreenLoading = false;
          if (res.code === 200) {
            if (null != res.data && res.data.length > 0) {
              this.tableData = res.data;
            } else {
              this.titps = "暂无数据";
            }
          } else {
            this.titps = "暂无数据";
          }
        },
        error => {
          console.log(error);
        }
      );
    }
  },
  mounted() {
    this.systemReamrk = this.data["sysRemark"];
  }
};
</script>

<style>
.top {
  text-align: center;
}
</style>
